import request from "@/utils/request"
import type { CategoryListMode } from "./model/categoryModel"

enum Api {
  getCategory1ListApi = "/admin/product/getCategory1",
  getCategory2ListApi = "/admin/product/getCategory2",
  getCategory3ListApi = "/admin/product/getCategory3",
}

export const reqGetCategory1List = () =>
  request.get<any, CategoryListMode>(Api.getCategory1ListApi)

export const reqGetCategory2List = (category2Id: number) =>
  request.get<any, CategoryListMode>(
    Api.getCategory2ListApi + `/${category2Id}`
  )

export const reqGetCategory3List = (category3Id: number) =>
  request.get<any, CategoryListMode>(
    Api.getCategory3ListApi + `/${category3Id}`
  )
